package com.ruoyi.admin.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.admin.mapper.ZhxLikeBookMapper;
import com.ruoyi.admin.domain.ZhxLikeBook;
import com.ruoyi.admin.service.IZhxLikeBookService;

/**
 * 用户点赞书籍Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-11
 */
@Service
public class ZhxLikeBookServiceImpl implements IZhxLikeBookService 
{
    @Autowired
    private ZhxLikeBookMapper zhxLikeBookMapper;

    /**
     * 查询用户点赞书籍
     * 
     * @param likeBookId 用户点赞书籍主键
     * @return 用户点赞书籍
     */
    @Override
    public ZhxLikeBook selectZhxLikeBookByLikeBookId(Long likeBookId)
    {
        return zhxLikeBookMapper.selectZhxLikeBookByLikeBookId(likeBookId);
    }

    /**
     * 查询用户点赞书籍列表
     * 
     * @param zhxLikeBook 用户点赞书籍
     * @return 用户点赞书籍
     */
    @Override
    public List<ZhxLikeBook> selectZhxLikeBookList(ZhxLikeBook zhxLikeBook)
    {
        return zhxLikeBookMapper.selectZhxLikeBookList(zhxLikeBook);
    }

    /**
     * 新增用户点赞书籍
     * 
     * @param zhxLikeBook 用户点赞书籍
     * @return 结果
     */
    @Override
    public int insertZhxLikeBook(ZhxLikeBook zhxLikeBook)
    {
        zhxLikeBook.setCreateTime(DateUtils.getNowDate());
        return zhxLikeBookMapper.insertZhxLikeBook(zhxLikeBook);
    }

    /**
     * 修改用户点赞书籍
     * 
     * @param zhxLikeBook 用户点赞书籍
     * @return 结果
     */
    @Override
    public int updateZhxLikeBook(ZhxLikeBook zhxLikeBook)
    {
        return zhxLikeBookMapper.updateZhxLikeBook(zhxLikeBook);
    }

    /**
     * 批量删除用户点赞书籍
     * 
     * @param likeBookIds 需要删除的用户点赞书籍主键
     * @return 结果
     */
    @Override
    public int deleteZhxLikeBookByLikeBookIds(Long[] likeBookIds)
    {
        return zhxLikeBookMapper.deleteZhxLikeBookByLikeBookIds(likeBookIds);
    }

    /**
     * 删除用户点赞书籍信息
     * 
     * @param likeBookId 用户点赞书籍主键
     * @return 结果
     */
    @Override
    public int deleteZhxLikeBookByLikeBookId(Long likeBookId)
    {
        return zhxLikeBookMapper.deleteZhxLikeBookByLikeBookId(likeBookId);
    }
}
